package com.misboot.document.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.misboot.document.mapper.OfDocumentVersioningMapper;
import com.misboot.document.model.OfDocumentVersioning;
import com.misboot.document.service.OfDocumentVersioningService;
import com.misboot.document.service.impl.DocumentBaseServiceImpl;
import com.misboot.document.utils.PageUtil.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("ofDocumentVersioningServiceImpl")
public class OfDocumentVersioningServiceImpl extends DocumentBaseServiceImpl<OfDocumentVersioning, String> implements OfDocumentVersioningService {

    @Autowired
    private OfDocumentVersioningMapper ofDocumentVersioningMapper;

    //分页
    @Override
    public PageSet<OfDocumentVersioning> getPageSet(PageParam pageParam, String filterSort) {
        PageHelper.startPage(pageParam.getPageNo(), pageParam.getPageSize());
        List<OfDocumentVersioning> list = ofDocumentVersioningMapper.getPageSet(filterSort);
        PageInfo<OfDocumentVersioning> pageInfo = new PageInfo<>(list);
        return PageUtils.getPageSet(pageInfo);
    }

    //批量删除
    @Override
    public int executeDeleteBatch(String[] varchar) {
        return ofDocumentVersioningMapper.executeDeleteBatch(varchar);
    }

}
